/*
 * CBezierSurfaces.h
 *
 *  Created on: 31.07.2009
 *      Author: cfuerst
 */

bool read_TP_surface(char filename[200], usigned &m, unsigned &n,
					 double &a1, double &b1, double &a2, double &b2, vector<CPt> &bij);

bool decas(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
		   vector<CPt> bij, double u, double v, CPt &point);

bool grid_points(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
				 vector<CPt> bij, unsigned NoP1, unsigned NoP2, vector<CPt> &points);

bool deriv_1_2(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
			   vector<CPt> bij, double u, double v, CPt &deriv_u, CPt &deriv_v,
			   CPt &deriv_uu, CPt &deriv_uv, CPt &deriv_vv);

bool deriv_1_2(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
			   vector<CPt> bij, vector<CPt> &deriv_u, vector<CPt> &deriv_v,
			   vector<CPt> &deriv_uu, vector<CPt> &deriv_uv, vector<CPt> &deriv_vv);

bool approx_TP_surface(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
					   vector<CPt> bij, unsigned iter_depth, unsigned NoP_m, unsigned NoP_n,
					   vector<CPt> &net);

bool deg_raising(unsigned m, unsigned n, vector<CPt> bij, unsigned raise_m, unsigned &m_new,
				 unsigned &n_new, vector<CPt> &bij_raised);

bool subdivision(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
				 vector<CPt> bij, double u, double v, double &a11, double &b11,
				 double &a12, double &b12, vector<CPt> &bij1, double &a21,
				 double &b21, double &a22, double &b22, vector<CPt> &bij2);

bool int_change(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
				vector<CPt> bij_ab, double c1, double d1, double c2, double d2, vector<CPt> &bij_cd);

bool bezier_2_monom(unsigned m, unsigned n, double a1, double b1, double a2, double b2,
					vector<CPt> bij, vector<CPt> &monom);

bool bounding_boxes(unsigned m, unsigned n, vector<CPt> bi, vector<CPt> bij, bool &empty, CPt &point1, CPt &point2);

bool bound_boxes(unsigned m, unsigned n, double a, double b, vector<CPt> bi, double a1, double b1,
				 double a2, double b2, vector<CPt> bij, bool &empty, vector<double> &intersect_points);

bool TP_maple_out(char filename[200], unsigned m, unsigned n, vector<CPt> bij);

bool monom_maple_out(char filename[200], unsigned m, unsigned n, vector<CPt> bij);

